package Exc.controller;

import Exc.domain.JSONResult;
import Exc.domain.Manager;
import Exc.service.IManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * The type Manager controller.
 */
@Controller()
@RequestMapping("/loginFirst")
public class ManagerController {
    @Autowired
    private IManagerService managerService;

    /**
     * List manager json result.
     *
     * @return the json result
     */
    @RequestMapping("/listManager")
    @ResponseBody
    public JSONResult listManager() {
        List<Manager> managerList = managerService.listManager();
        JSONResult jsonResult = new JSONResult(true, "返回Manager账号信息", managerList);
        return jsonResult;
    }
}
